package com.macaline.aviator;

import java.util.HashMap;
import java.util.Map;
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;

public class Main {
    public static void main(String[] args) {
        String expression = "((content  == '二月份餐饮报销发票' && string.contains(content,containsStr)) && !string.contains(content,notContainsStr))";
        Expression compiledExp = AviatorEvaluator.compile(expression);
        Map<String, Object> env = new HashMap<>();
        env.put("content", "二月份餐饮报销发票");
        env.put("filed1", "二月份餐饮报销发票");
        env.put("containsStr", "二月");
        env.put("notContainsStr", "发2票");
        Boolean result = (Boolean) compiledExp.execute(env);
        System.out.println(result);
    }
}
